-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf event array map kernel-side implementation. #4144
base: main
Are you sure you want to change the base?
Conversation
7623a4f
to
10d4f86
Compare
d5f2cea
to
a5f9711
Compare
return ring->consumer_offset % ring->length; | ||
} | ||
|
||
inline static size_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider refactoring. There is too much code that are near identical to the ring_buffer module. Maybe a module that is common to both??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. With some refactoring ebpf_ringbuffer (the generic implementation) could work for both perf event array and ring buffer map. Then the core maps would add the ring-buffer and perf array-specific logic.
size_t producer_offset; | ||
uint8_t* shared_buffer; | ||
ebpf_ring_descriptor_t* ring_descriptor; | ||
size_t lost_records; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the _ebpf_perf_ring
"derive" from _ebpf_ring_buffer
? Also see my other comment below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not directly as is - but yes.
I'm working on refactoring ebpf_ringbuffer so perf ring and the ring buffer map can both derive from ebpf_ringbuffer.
@@ -215,6 +215,9 @@ _ebpf_link_client_attach_provider( | |||
client_dispatch_table = (void*)&_ebpf_link_dispatch_table_with_context_header; | |||
} else { | |||
client_dispatch_table = (void*)&_ebpf_link_dispatch_table; | |||
// TODO: Before merging perf event array context headers must be required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is to ensure context headers are mandatory before this PR is merged.
Description
Implements the kernel side of perf event array maps.
Testing
Includes platform and execution context tests.
Documentation
Documented in code.
Installation
N/A